import type { Profile, ProfileParams, User } from "@/types/http";
import request from "@/utils/request";

/**
 * 获取个人信息
 */
export const getUserInfoApi = () => {
  return request<User>({
    method: 'get',
    url: '/user'
  })
}

export const getProfileApi = () => {
  return request<Profile>({
    method: 'get',
    url: '/user/profile'
  })
}

export const patchProfileApi = (data: ProfileParams) => {
  return request<null>({
    method: 'patch',
    url: '/user/profile',
    data
  })
}